package com.sskj.spk.bean;

import android.text.TextUtils;

import com.github.tifezh.kchartlib.chart.entity.IBOLL;
import com.github.tifezh.kchartlib.chart.entity.IKDJ;
import com.github.tifezh.kchartlib.chart.entity.IKLine;
import com.github.tifezh.kchartlib.chart.entity.IMACD;
import com.github.tifezh.kchartlib.chart.entity.IMinuteLine;
import com.github.tifezh.kchartlib.chart.entity.IRSI;
import com.github.tifezh.kchartlib.chart.entity.IWR;

import java.util.Date;

/**
 * Created by Administrator on 2018/4/3.
 */

public class Stock implements IKLine, IMinuteLine, IBOLL, IKDJ, IMACD, IRSI, IWR {


    public float MA5Price;

    public float MA10Price;

    public float MA20Price;

    public float dea;

    public float dif;

    public float macd;

    public float k;

    public float d;

    public float j;

    public float rsi1;

    public float rsi2;

    public float rsi3;

    public float up;

    public float mb;

    public float dn;

    public float MA5Volume;

    public float MA10Volume;
    /**
     * id : 2271121
     * code : BTC/USDT
     * period :
     * volume : 1.73359092
     * price :
     * openingPrice : 7611.414
     * closingPrice : 7611.4262
     * prevClose :
     * highestPrice : 7615.667
     * lowestPrice : 7610
     * timestamp : 1533114360000
     * createTime :
     * isDeleted : 0
     * timestamp : 1533114400000
     */

    private int id;
    private String code;
    private String period;
    private double volume;
    private String price;
    private double openingPrice;
    private double closingPrice;
    private String prevClose;
    private double highestPrice;
    private double lowestPrice;
    private long timestamp;


    public float wr;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getPeriod() {
        return period;
    }

    public void setPeriod(String period) {
        this.period = period;
    }

    public float getVolume() {
        return (float) volume;
    }

    @Override
    public float getMA5Volume() {
        return MA5Volume;
    }

    @Override
    public float getMA10Volume() {
        return MA10Volume;
    }

    public void setVolume(double volume) {
        this.volume = volume;
    }

    @Override
    public float getAvgPrice() {
        return 0;
    }

    public float getPrice() {
        return TextUtils.isEmpty(price) ? 0 : Float.valueOf(price);
    }

    @Override
    public Date getMinuteDate() {
        return new Date(timestamp*1000);
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public float getOpenPrice() {
        return (float) openingPrice;
    }

    @Override
    public float getHighPrice() {
        return (float) highestPrice;
    }

    @Override
    public float getLowPrice() {
        return (float) lowestPrice;
    }

    public void setOpeningPrice(double openingPrice) {
        this.openingPrice = openingPrice;
    }

    public float getClosePrice() {
        return (float) closingPrice;
    }

    @Override
    public void setClosePrice(float closePrice) {
        this.closingPrice = closePrice;
    }

    @Override
    public float getMA5Price() {
        return MA5Price;
    }

    @Override
    public float getMA10Price() {
        return MA10Price;
    }

    @Override
    public float getMA20Price() {
        return MA20Price;
    }

    @Override
    public long getDatetime() {
        return timestamp*1000;
    }

    public void setClosePrice(double closePrice) {
        this.closingPrice = closePrice;
    }

    @Override
    public float getUp() {
        return up;
    }

    @Override
    public float getMb() {
        return mb;
    }

    @Override
    public float getDn() {
        return dn;
    }

    @Override
    public float getK() {
        return k;
    }

    @Override
    public float getD() {
        return d;
    }

    @Override
    public float getJ() {
        return j;
    }

    @Override
    public float getDea() {
        return dea;
    }

    @Override
    public float getDif() {
        return dif;
    }

    @Override
    public float getMacd() {
        return macd;
    }

    @Override
    public float getRsi1() {
        return rsi1;
    }

    @Override
    public float getRsi2() {
        return rsi2;
    }

    @Override
    public float getRsi3() {
        return rsi3;
    }

    @Override
    public float getWr() {
        return 0;
    }
    /**
     * id : 2271121
     * code : BTC/USDT
     * period :
     * volume : 1.73359092
     * price :
     * openingPrice : 7611.414
     * closingPrice : 7611.4262
     * prevClose :
     * highestPrice : 7615.667
     * lowestPrice : 7610
     * timestamp : 1533114360000
     * createTime :
     * isDeleted : 0
     * timestamp : 1533114400000
     */


}
